package com.zhou.project.modules.circle.circlePostsCommentYes.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhou.project.modules.circle.circlePostsCommentYes.entity.CommentYes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

public interface CommentYesDao extends BaseMapper<CommentYes> {
    @Select("select count(*) from ucc_circle_comment_yes where comment_id=#{commentId} and created_by=#{userId} and delete_flag=0")
    int oneYes(int commentId,int userId);
    @Delete("delete from ucc_circle_comment_yes where comment_id=#{commentId} and created_by=#{userId}")
    int deleteThis(int commentId,int userId);

    @Select("select count(*) from ucc_circle_comment_yes where comment_id=#{commentId} and delete_flag=0")
    long countCommentYes(int commentId);
}
